<template>
	<view class="u-rela u-p-20">
		<view class="u-p-b-20 u-border-bottom u-m-b-20">
			<u-image width="100%" height="380rpx" :src="detail.photo"></u-image>
		</view>
		<view class="">
			姓名：{{detail.name}}
		</view>
		<view class="u-m-t-10">
			性别：{{detail.sex | getSex}}
		</view>
		<view class="u-m-t-10">
			电话：{{detail.companyphone}}
		</view>
		<view class="u-m-t-10">
			简介：{{detail.remarks}}
		</view>
		<view class="btn">
			<u-button type="primary" @click='call(detail.companyphone)'>致电联系</u-button>
		</view>
	</view>
</template>

<script>
	import {housekeeping} from '@/static/data.js'
	import {viewHousekeeper}from '@/api/index.js'
	export default {
		data() {
			return {
				detail:{}
			}
		},
		onLoad(e) {
			this.viewHousekeeper(e.id)
		},
		methods: {
			viewHousekeeper(id){
				viewHousekeeper({id}).then(res=>{
					this.detail = res
				})
			},
			call(tel){
				// #ifndef APP-PLUS
				uni.makePhoneCall({
					phoneNumber: tel //仅为示例
				});
				// #endif
				
				// #ifdef APP-PLUS
				plus.device.dial(tel, true);
				// #endif
			},
		}
	}
</script>

<style>
.btn{
	position: fixed;
	bottom: 20rpx;
	width: calc(100% - 40rpx);
}
</style>
